var deappAddress = "n1qkkQwrs9Y8MBaUu6UUvx7wBPDimdq7gZh";
var hash = "8ec2a16e315e6a38301ebafcbfab3cefdc4519420ad0c6d8082c180a3f94a759";
var NebPay = require("nebpay");
var nebPay = new NebPay();

/*  添加信息和智能合约交互 */
function setInformation(birthday,email){
	nebPay.call(dappAddress,"0","set",JSON.stringify([birthday,email]),{
		listener:function(res){
			if(res.txhash){
				console.log('信息添加成功，1分钟后可查询信息')
			}
		}
	})
}

/* 查询信息和只能合约交互 */
function getInformation(birthday){
	nebPay.simulateCall(dappAddress,"0","get",JSON.stringify([birthday]),{
		listener:function(res){
			loading(false);
			if(res.result == '' &&res.execute_err == 'contract check failed'){
				toast('合约查询失败，检查浏览器钱包插件')
				return;
			}
			var datalist = JSON.parse(res.result);
			console.log(datalist);
		}
	})
}